package com.zhj.micro.product.controller;

import com.zhj.micro.product.entity.dto.ProductDTO;
import com.zhj.micro.product.service.ProductService;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/product")
public class ProductController {

    @Resource
    private ProductService productService;

    /**
     * 添加商品信息
     * @return
     */
    @PostMapping("/insert")
    public boolean insert(@RequestBody ProductDTO productDTO) {
        return productService.insert(productDTO) > 0;
    }

}
